<!DOCTYPE html>
<html lang="en">
<head>
    <meta name="layout" content="bocMain"/>
    <title>进件作业系统</title>
</head>
<body>
<div class="wx-ca-txt">
    问卷调查
</div>
<div class="weui-cells__title">
    为了给您提供更方便的更好的服务，希望您能抽出几分钟时间，如实填写该问卷，我们非常重视每位用户的宝贵时间，期待您的参与。
</div>

<div class="weui-cells__title" style="font-weight: bold;">
    您选择的问卷模板名称：${this?.questionnaireInstance?.name}
</div>

<g:form action="questionnaireSurveySave">
    <input type="hidden" id="id" name="id" value="${this?.opportunity?.id}">
    <input type="hidden" id="questionnaireInstanceId" name="questionnaireInstanceId" value="${this?.questionnaireInstance?.id}">
    <g:set var="counter" value="${1}" />
    <g:each in="${com.next.QuestionInstance.findAllByQuestionnaireInstance(this?.questionnaireInstance, [order:'asc', sort: 'displayOrder'])}" var="qi">
        <div class="weui-cells">
            <div class="weui-cells__title">
                <span class="required" style="color: red">*</span>${counter++}.${qi?.name}
            </div>

            <g:if test="${qi?.questionType == 'radio'}">
                <g:each in="${com.next.OptionInstance.findAllByQuestionInstance(qi, [order:'asc', sort: 'displayOrder'])}" var="oi">
                    <div class="weui-cell">
                        <div class="weui-cell__bd">
                            <g:radioGroup name="${qi?.name}" id="${oi?.name}" labels="${oi*.name}" values="${oi*.name}">
                                <p>${it.radio} ${it.label} </p>
                            </g:radioGroup>
                        </div>
                    </div>
                </g:each>
            </g:if>

            <g:if test="${qi?.questionType == 'input'}">
                <div class="weui-cell">
                    <div class="weui-cell__bd">
                        <input class="weui-input" type="text" name="${qi?.name}" id="${qi?.name}" value="${qi?.value}" placeholder="请输入"/>
                    </div>
                </div>
            </g:if>

            <g:if test="${qi?.questionType == 'checkbox'}">
                <g:each in="${com.next.OptionInstance.findAllByQuestionInstance(qi, [order:'asc', sort: 'displayOrder'])}" var="oi">
                    <div class="weui-cell">
                        <div class="weui-cell__bd">
                            <label><input name="${oi?.name}" type="checkbox" value="${true}"/>${oi?.name} </label>
                        </div>
                    </div>
                </g:each>
            </g:if>
        </div>

    </g:each>

    <div class="bigBtn weui-flex">
        <button type="button" class="weui-btn weui-btn_primary" id="downMe" style="margin-top: 15px;margin-right: 10px;">拒绝</button>
        <button type="submit" class="weui-btn weui-btn_primary" id="submit">下一步</button>
    </div>
</g:form>
</body>
</html>
